﻿package chapter_03_Homework;

public class Work_02_Penguin {
	String name = "无名氏";//昵称

	int health = 100;//健康值

	int love = 0;//亲密度

	static final String SEX_MALE = "Q仔";
	static final String SEX_FEMALE = "Q妹";
	String sex = SEX_MALE;

	/**
	 * 输出企鹅的信息
	 */
	public void print(){
		System.out.println("宠物的自白：\n我的名字叫"+this.name+"，健康值是"+this.health+"，和主人的亲密度是"+this.love+"，性别是"+this.sex+"。");
	}

	public static void main(String[] args) {
		Work_02_Penguin pgn = null;
		pgn = new Work_02_Penguin();
		System.out.println("第一个企鹅的性别是"+pgn.sex+"。");

		pgn = new Work_02_Penguin();
		pgn.sex = Work_02_Penguin.SEX_FEMALE;
		System.out.println("第二个企鹅的性别是"+pgn.sex+"。");

		pgn = new Work_02_Penguin();
		pgn.sex = Work_02_Penguin.SEX_MALE;
		System.out.println("第三个企鹅的性别是"+pgn.sex+"。");
		pgn.print();
	}
}

